<template>
	<view class="customer_dynamic">
		<view class="fllow_item" v-for="(item,index) in list" :key="index"
			@click.stop="isSeas == 1 ? clientClick(item.id) : ''">
			<view class="item_content">
				<view class="con_img">
					<image style="width: 129rpx;height: 129rpx;border-radius: 50%;margin: 23rpx 36rpx 42rpx 35rpx;"
						:src="BASE_IMG_URL+'headImg.png'" class="headerimg" mode="scaleToFill">
					</image>

					<view class="main_first">
						<view class="main_title">
							<view class="first_left">
								<view class="f_l_yop">
									<view>{{item.followup_staff_name}}</view>
									<view class="main_type daofang" style="width: auto;">{{(item && item.followup_type_desc) ? item.followup_type_desc : ''}}</view>
								</view>
								<view class="f_l_bottom" style="margin-top: 30rpx;">
									<view class="" v-if="item.followup_finish_time">
										{{item.followup_finish_time}}
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
				<view class="con_main">
					<view class="main_second">
						<view>{{item.followup_content}}</view>
					</view>
					<view class="main_img" v-if="item.file.length != 0" @tap.stop.prevent>
						<image 
							:src="ele.file_path" 
							v-for="(ele,fileindex) in item.file" 
							:key="fileindex" 
							v-if="ele.types == 'image'" 
							class="imgbox" 
							 mode="scaleToFill"
							@click.stop="toPrevieImg(ele.file_path)"
						></image>
					</view>
					<!-- <view class="lxs_time">客户：{{item.memberName}}</view> -->
				</view>
				<view class="comment">
					<image :src="BASE_IMG_URL+'pl.png'" mode="scaleToFill"></image>
					<view class="span">
						查看评论
					</view>
				</view>
			</view>
		</view>
		
		<u-empty v-if="list.length == 0" text="暂无更多"></u-empty>
	</view>
</template>

<script>
	import {
		netKehuFollow,
		netGetCommentList,
		netFollowRecordDetail
	} from '@/api/kehu.js'
	import {
		BASE_IMG_URL
	} from '@/util/api.js'
	export default {
		props: {
			kehuid: {
				type: Number,
				default: null
			},
			type: {
				type: Number,
				default: 1 //1客户 2联系人 3合同
			},
			isSeas: {
				type: Number,
				default: 1, //1普通客户   2公海客户
			}
		},
		data() {
			return {
				list: [],
				page: 1,
				limit: 10,
				totalPage: 1,
				commont_list: [], //评论列表
				id: '',
				info: {},
				// lists:[],
				BASE_IMG_URL: BASE_IMG_URL,
				amount: [],
			}
		},
		created() {
			this.getFollowList()
		},
		onReachBottom() {
			if (this.page >= this.totalPage) {
				return
			}
			this.page = this.page + 1
			this.getFollowList()
		},
		onLoad(options) {
			
		},
		onShow() {
		},
		methods: {
			// 跳转到详情页面 
			clientClick(id) {
				uni.navigateTo({
					url:'/pagesA/crm/cluesManagement/followUpDetail/followUpDetail?followup_id='+id,
					success:()=>{
						 
					}
				}) 
			},
			getFollowList() {
				let params = {
					page: this.page,
					limit: this.limit,
					member_id: this.kehuid,
					followup_filter: 2
				}
				netKehuFollow(params).then(res=>{
					this.list = (res.data.list)
					this.totalPage = res.data.totalPage
				})
			},
			//查看 图片 
			toPrevieImg(file) {
				uni.previewImage({
					urls: [file]
				})
			}
		}
	}
</script>

<style lang="scss">
	.comment {
		margin-top: 20rpx;
		height: 90rpx;
		background: #fff;
		border-top: 1rpx solid #ededed;
		text-align: center;
		display: flex;
		justify-content: center;
		align-items: center;
		image {
			width: 40rpx;
			height: 36rpx;
			float: left;
			margin-right:20rpx;
		}
	}

	.customer_dynamic {
		margin: 20rpx 0rpx;

		.fllow_item {

			.item_data {
				// margin: 30rpx 0;

				&::before {
					content: '';
					display: inline-block;
					margin: 0 15rpx 0 24rpx;
					width: 20rpx;
					height: 20rpx;
					border-radius: 10rpx;
					border: 2rpx solid #03aa96;
				}
			}

			.item_content {
				display: block;
				background-color: #fff;
				padding: 24rpx 24rpx 10rpx;
				border-radius: 10rpx;
				margin-bottom: 30rpx;

				.con_img {
					display: flex;

					.main_first {
						margin-bottom: 25rpx;
						padding-left: 25rpx;
						flex: 1;

						.main_time {
							line-height: 25px;
						}

						.main_title {
							display: flex;
							width: 100%;
							justify-content: space-between;

							.first_left {
								width: 100%;
								margin-top: 25rpx;

								.f_l_yop {
									width: 100%;
									display: flex;
									justify-content: space-around;
								}

								:first-child {
									font-size: 32rpx;
									margin-right: 10rpx;
									margin-top: -3rpx;
								}

								:last-child {
									margin-top: 2rpx;
								}
							}

							.main_type {
								margin-left: 20rpx;
								margin: 20rpx;
								width: 85rpx;
								height: 36rpx;
								background: rgba(3, 170, 150, .1);
								// padding: 5rpx 20rpx;
								border-radius: 10rpx;
								color: #03AA96;
								text-align: center;
								line-height: 36rpx;
							}
						}

					}

					image {
						width: 100rpx;
						height: 100rpx;
						border-radius: 50%;
					}
				}

				.con_main {
					flex: 1;
					margin-left: 30rpx;
					font-size: 30rpx;
					color: #666666;

					.main_second {
						padding-bottom: 20rpx;
					}

					.main_img {
						display: flex;
						justify-content: flex-start;
						align-items: center;
						flex-wrap: wrap;
						margin-top: 20rpx;

						.imgbox {
							padding: 10rpx;
							border: 1rpx solid #CCC;
							border-radius: 10rpx;
							width: 160rpx;
							height: 160rpx;
							margin-right: 14rpx;
							margin-bottom: 14rpx;
						}
					}

					.main_third {
						display: flex;
						justify-content: space-between;
						align-items: center;
						margin: 20rpx 0 10rpx;

						.third_left {
							display: flex;
							justify-content: center;
							align-items: center;

							.icon-setup {
								margin-top: -4rpx;
								margin-right: 10rpx;
							}
						}

						.third_right {
							display: flex;

							.right_num {
								display: flex;

								.icon-shaixuan {
									margin-top: -4rpx;
									margin-right: 10rpx;
								}

								:last-child {
									margin-right: 20rpx;
								}
							}

							.icon-arrows_right {
								margin-top: -4rpx;
							}
						}
					}

					.main_fourth {
						padding-bottom: 10rpx;
					}
				}
			}
		}

		.fontColor {
			color: #999;
		}

	}
</style>
